package com.aegean.CommercialHotelBookSystem.shop.listener;

import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;

import com.aegean.CommercialHotelBookSystem.factory.BusinessFactory;
import com.aegean.CommercialHotelBookSystem.shop.business.IShopBusiness;

/**
 * Application Lifecycle Listener implementation class RoomClickListener
 *
 */
public class RoomClickListener implements ServletRequestListener {

	@Override
	public void requestDestroyed(ServletRequestEvent event) {
		// TODO Auto-generated method stub
	}

	@Override
	public void requestInitialized(ServletRequestEvent event) {
		ServletRequest request = event.getServletRequest();
		String room_Id=request.getParameter("room_Id");
		if (room_Id!= null) {
			IShopBusiness business = BusinessFactory.createShopBusiness();
			business.clickRoom(room_Id);
		}
	}
	
}
